
import {member as memberApi} from '@/http';

export default {
    namespaced: true,
    state: {
        loading : false,
        data : {
            toinfo : {
                phone : ''
            }
        }
    },
    mutations: {
        loading(state,e){
            state.loading = e;
        },
        data(state,e){
            state.data = e;
        }
    },
    actions: {
        initdata({commit,state},update){
            var that = this;
            if(state.data.id && !update) return false;
            commit('loading',true);
            memberApi.post('vip/wxVipInfo').then(res => {
                if(!res.data.code){
                    commit('data',res.data.data);
                }
                commit('loading',false);
                // console.log(res.data.data)
            })
              .catch(err => {
                // console.log(11)
                localStorage.removeItem('user');
                localStorage.removeItem('company');
                localStorage.removeItem('api_token');
                localStorage.removeItem('refresh_token');
                location.reload()
              })
        }
    },
    getters : {

    },
    modules: {

    }
};
